import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";


@Entity("access")
export class AccessEntity {

	@PrimaryGeneratedColumn({
		type: "int",
		name: "id"
	})
	id: number;


	@Column("varchar", {
		nullable: false,
		length: 50,
		name: "uuid"
	})
	uuid: string;


	@Column("varchar", {
		nullable: true,
		unique: true,
		length: 50,
		name: "module_name"
	})
	moduleName: string | null;


	@Column("enum", {
		nullable: true,
		enum: ["1", "2", "3"],
		name: "type"
	})
	type: string | null;


	@Column("varchar", {
		nullable: true,
		unique: true,
		length: 100,
		name: "action_name"
	})
	actionName: string | null;


	@Column("varchar", {
		nullable: true,
		length: 100,
		name: "icon"
	})
	icon: string | null;


	@Column("varchar", {
		nullable: true,
		length: 100,
		name: "url"
	})
	url: string | null;


	@Column("varchar", {
		nullable: true,
		length: 10,
		name: "method"
	})
	method: string | null;


	@Column("int", {
		nullable: false,
		default: () => "'-1'",
		name: "module_id"
	})
	moduleId: number;


	@Column("varchar", {
		nullable: true,
		length: 50,
		name: "platform"
	})
	platform: string | null;


	@Column("int", {
		nullable: false,
		default: () => "'1'",
		name: "sort"
	})
	sort: number;


	@Column("varchar", {
		nullable: true,
		length: 100,
		name: "description"
	})
	description: string | null;


	@Column("tinyint", {
		nullable: true,
		default: () => "'1'",
		name: "status"
	})
	status: number | null;


	@Column("timestamp", {
		nullable: false,
		default: () => "CURRENT_TIMESTAMP",
		name: "created_at"
	})
	createdAt: Date;


	@Column("timestamp", {
		nullable: false,
		default: () => "CURRENT_TIMESTAMP",
		name: "updated_at"
	})
	updatedAt: Date;

}
